ChannelNumber = "" 'Initialize variable. TestSentence = Trim(HalBrain.AlphaNumericalOnly(UserSentence)) 'Get rid of punctuation and end spaces. If InStr(1, TestSentence, "TURN ON TELEVISION CHANNEL ", 1) > 0 Or InStr(1, TestSentence, "TURN TO TELEVISION CHANNEL ", 1) > 0 Or InStr(1, TestSentence, "SELECT TELEVISION CHANNEL ", 1) > 0 Then TestSentenceArray = Split(TestSentence, " ", -1, vbBinaryCompare) 'Split TestSentence into an array of words. If (IsArray(TestSentenceArray) = True And UBound(TestSentenceArray) > -1) Then For X = 0 To UBound(TestSentenceArray) If Trim(TestSentenceArray(X)) = "CHANNEL" And UBound(TestSentenceArray) >= (X + 1) Then ChannelNumber = Trim(TestSentenceArray(X + 1)) 'Set ChannelNumber to the word or number following the word "CHANNEL". X = 1000 'If channel number is found then break loop. 'When using Girder just replace GetResponse with the variable you want to assign the channel number to. If ChannelNumber <> "" And IsNumeric(ChannelNumber) = True Then GetResponse = ChannelNumber GetResponseBlock = True 'Only needed if you are using GetResponse. End If Next End If End If